﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="辅料采购清单0.aspx.cs" Inherits="syc.Sale.辅料采购清单0" %>

<head runat="server">
    <title></title>
</head>
<body>
    <script type="text/javascript" language="javascript" src="/common.js"></script>
    <form id="form1" runat="server">
    <div id="wintop" class="wintop">供应处辅料采购及资金计划</div>
        <asp:Panel ID="Panel1" runat="server" CssClass="panel">
        
            <span style="display:inline-block;width:160px;text-align:right;">
            
                年&nbsp; 度：<asp:DropDownList ID="NianDu" runat="server" Width="80px" AutoPostBack="true">                    
                    <asp:ListItem>2009</asp:ListItem>
                    <asp:ListItem>2010</asp:ListItem>
                    <asp:ListItem>2011</asp:ListItem>
                    <asp:ListItem>2012</asp:ListItem>
                    <asp:ListItem>2013</asp:ListItem>
                    <asp:ListItem>2014</asp:ListItem>
                    <asp:ListItem>2015</asp:ListItem>
                </asp:DropDownList>
            </span>          
            <span style="display:inline-block;width:160px;text-align:right;margin-right:30px;">
                月(季) 份：<asp:DropDownList ID="YueFen" runat="server" Width="80px" AutoPostBack="true">
                    <asp:ListItem Value="0">年度</asp:ListItem>
                    <asp:ListItem Value="1">1月份</asp:ListItem>
                    <asp:ListItem Value="2">2月份</asp:ListItem>
                    <asp:ListItem Value="3">3月份</asp:ListItem>
                    <asp:ListItem Value="4">4月份</asp:ListItem>
                    <asp:ListItem Value="5">5月份</asp:ListItem>
                    <asp:ListItem Value="6">6月份</asp:ListItem>
                    <asp:ListItem Value="7">7月份</asp:ListItem>
                    <asp:ListItem Value="8">8月份</asp:ListItem>
                    <asp:ListItem Value="9">9月份</asp:ListItem>
                    <asp:ListItem Value="10">10月份</asp:ListItem>
                    <asp:ListItem Value="11">11月份</asp:ListItem>
                    <asp:ListItem Value="12">12月份</asp:ListItem>
                    <asp:ListItem Value="13">1季度</asp:ListItem>
                    <asp:ListItem Value="14">2季度</asp:ListItem>
                    <asp:ListItem Value="13">3季度</asp:ListItem>
                    <asp:ListItem Value="14">4季度</asp:ListItem>
                </asp:DropDownList> 
            </span>
            
                        
            
      
            <input type="button" value="关 闭" class="button" onclick="parent.swin_close();" />
            <asp:Button ID="Button_Export" runat="server" CssClass="button" 
                onclick="Button_Export_Click" Text="导出Excel" UseSubmitBehavior="false" />
            <br />
            <br />
            </asp:Panel>
            <asp:Panel ID="Panel3" runat="server" CssClass="panel" Visible="false">
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 辅 料：<asp:DropDownList 
                ID="FuLiao" runat="server" AutoPostBack="True" Width="140px" 
                DataSourceID="SqlDataSource2" DataTextField="品名" DataValueField="ID">
                <asp:ListItem>2009</asp:ListItem>
                <asp:ListItem>2010</asp:ListItem>
                <asp:ListItem>2011</asp:ListItem>
                <asp:ListItem>2012</asp:ListItem>
                <asp:ListItem>2013</asp:ListItem>
                <asp:ListItem>2014</asp:ListItem>
                <asp:ListItem>2015</asp:ListItem>
            </asp:DropDownList>            
        
            &nbsp;&nbsp;&nbsp; 计划采购量：<asp:TextBox ID="JiHuaLiang" runat="server" Width="96px"></asp:TextBox>
            &nbsp;&nbsp;&nbsp; 单价：<asp:TextBox ID="DanJia" runat="server" Width="96px"></asp:TextBox>
        
        </asp:Panel>
        
        <asp:Panel ID="Panel2" runat="server" CssClass="panel2">
            <asp:Label ID="Message" runat="server" Text="·准备就绪" CssClass="prompt"></asp:Label>
            <asp:SqlDataSource ID="SqlDataSource2" runat="server" 
                ConnectionString="<%$ ConnectionStrings:SCMConnectionString1 %>" 
                SelectCommand="SELECT ID,品名+' '+规格 as 品名 FROM [材料]"></asp:SqlDataSource>
        </asp:Panel>
         <div class="gridframe">
        <div class="gridview">
        
            <table border="1" width="100%" cellspacing="0" cellpadding="0" bordercolor="#e5cfab">
	            <tr>
		            <td class="grid-title">计划清单</td>
		        </tr>
		        <tr>
		            <td class="grid-back">
                        <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
                            ConnectionString="<%$ ConnectionStrings:SCMConnectionString1 %>" 
                             SelectCommand="select 辅料ID,品名,规格,单位,计划购进量,辅料采购计划0.单价,金额 from 辅料采购计划0 inner join 材料 on 辅料采购计划0.辅料ID=材料.ID where 年度=@年度 and 月份=@月份"
                            
                              DeleteCommand="delete 辅料采购计划0 where 年度=@年度 and 月份=@月份 and 辅料ID=@辅料ID"
                             >
                             <SelectParameters>
                                <asp:ControlParameter ControlID="NianDu" Name="年度" PropertyName="SelectedValue" 
                                     Type="Int32" />
                                 <asp:ControlParameter ControlID="YueFen" Name="月份" PropertyName="SelectedValue" 
                                     Type="Int32" /> 
                             </SelectParameters>
                             <UpdateParameters>
                                 <asp:ControlParameter ControlID="NianDu" Name="年度" PropertyName="SelectedValue" 
                                     Type="Int32" />
                                 <asp:ControlParameter ControlID="YueFen" Name="月份" PropertyName="SelectedValue" 
                                     Type="Int32" />
                             </UpdateParameters>
                             <DeleteParameters>
                                 <asp:ControlParameter ControlID="NianDu" Name="年度" PropertyName="SelectedValue" 
                                     Type="Int32" />
                                 <asp:ControlParameter ControlID="YueFen" Name="月份" PropertyName="SelectedValue" 
                                     Type="Int32" />                             
                             </DeleteParameters>
                             </asp:SqlDataSource>
                        <asp:GridView ID="GridView1" runat="server" AllowPaging="True" PageSize="20"
                            AutoGenerateColumns="False" CssClass="grid" 
                            DataSourceID="SqlDataSource1" 
                            GridLines="None" ondatabound="GridView1_DataBound" 
                            onpageindexchanged="GridView1_PageIndexChanged" 
                            UseAccessibleHeader="False" DataKeyNames="辅料ID" 
                            onrowediting="GridView1_RowEditing">
                            <PagerSettings Visible="False" />
                            <RowStyle CssClass="grid-row-normal" />
                            <Columns>
                            
                                <asp:TemplateField HeaderText="">
                                    <ItemTemplate>
                                        <asp:Button ID="Button0" runat="server" CommandName="Select" Text="选择" CssClass="hide"/>
                                        <img src="/Icons/online.gif" style="margin-top:2px;" alt="" />
                                    </ItemTemplate>
                                    <HeaderStyle CssClass="grid-header" />
                                    <ItemStyle CssClass="grid" HorizontalAlign="Center" Width="20px" />
                                </asp:TemplateField>      
                                <asp:TemplateField HeaderText="辅料ID" SortExpression="辅料ID">
                                    <ItemTemplate>
                                        <asp:Label ID="Label0" runat="server" Text='<%# Bind("辅料ID") %>'  ></asp:Label>
                                    </ItemTemplate>
                                    <HeaderStyle CssClass="grid-header" />
                                    <ItemStyle CssClass="grid" HorizontalAlign="Center" Width="100px" />
                                </asp:TemplateField>                                  
                                <asp:TemplateField HeaderText="品名" SortExpression="品名">
                                    <ItemTemplate>
                                        <asp:Label ID="Label1" runat="server" Text='<%# Bind("品名") %>' ></asp:Label>
                                    </ItemTemplate>
                                    <HeaderStyle CssClass="grid-header" />
                                    <ItemStyle CssClass="grid" HorizontalAlign="Center" Width="100px" />
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="规格或型号" SortExpression="规格">
                                    <ItemTemplate>
                                        <asp:Label ID="Label2" runat="server" Text='<%# Bind("规格") %>' ></asp:Label>
                                    </ItemTemplate>
                                    <HeaderStyle CssClass="grid-header" />
                                    <ItemStyle CssClass="grid" HorizontalAlign="Center" Width="100px" />
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="单位" SortExpression="单位">
                                    <ItemTemplate>
                                        <asp:Label ID="Label3" runat="server" Text='<%# Bind("单位") %>' ></asp:Label>
                                    </ItemTemplate>
                                    <HeaderStyle CssClass="grid-header" />
                                    <ItemStyle CssClass="grid" HorizontalAlign="Center" Width="100px" />
                                </asp:TemplateField>  
                                 <asp:TemplateField HeaderText="计划购进" SortExpression="计划购进量">
                                  <EditItemTemplate>
                                        <asp:Label ID="Label4" runat="server" Text='<%# Eval("计划购进量") %>'></asp:Label>
                                    </EditItemTemplate>
                                    <ItemTemplate>
                                        <asp:Label ID="Label4" runat="server" Text='<%# Bind("计划购进量") %>' ></asp:Label>
                                    </ItemTemplate>
                                    <HeaderStyle CssClass="grid-header" />
                                    <ItemStyle CssClass="grid" HorizontalAlign="Center" Width="100px" />
                                </asp:TemplateField>
                                  <asp:TemplateField HeaderText="单价" SortExpression="单价">
                                  <EditItemTemplate>
                                        <asp:Label ID="Label5" runat="server" Text='<%# Eval("单价") %>'></asp:Label>
                                    </EditItemTemplate>
                                    <ItemTemplate>
                                        <asp:Label ID="Label5" runat="server" Text='<%# Bind("单价") %>' ></asp:Label>
                                    </ItemTemplate>
                                    <HeaderStyle CssClass="grid-header" />
                                    <ItemStyle CssClass="grid" HorizontalAlign="Center" Width="100px" />
                                </asp:TemplateField>                                
                                  <asp:TemplateField HeaderText="金额" SortExpression="金额">
                                    <EditItemTemplate>
                                        <asp:Label ID="Label6" runat="server" Text='<%# Eval("金额") %>'></asp:Label>
                                    </EditItemTemplate>
                                    <ItemTemplate>
                                        <asp:Label ID="Label6" runat="server" Text='<%# Bind("金额") %>' ></asp:Label>
                                    </ItemTemplate>
                                    <HeaderStyle CssClass="grid-header" />
                                    <ItemStyle CssClass="grid" HorizontalAlign="Center" Width="100px" />
                                </asp:TemplateField>                                                                  
                            </Columns>
                            
                            <SelectedRowStyle CssClass="grid-row-selected" />
                          </asp:GridView>
		            </td>
	            </tr>
	            <tr>
		            <td>   
		                <table width="100%">
		                    <tr>
		                        <td class="pagebar">
                                    <asp:Button ID="Button_Pager_First" runat="server" Text="" ToolTip="首页" 
                                        CssClass="pageturn-first-b" onclick="Pager_Click" CommandName="--" />
                                    <asp:Button ID="Button_Pager_Prev" runat="server" Text="" ToolTip="上一页" 
                                        CssClass="pageturn-prev-b" onclick="Pager_Click" CommandName="-" />
                                    <input type="button" class="page-split" />第<asp:TextBox ID="TextBox_Pager" runat="server" CssClass="pageturn" 
                                        ontextchanged="Pager_Click"></asp:TextBox>页<input type="button" class="page-split" /><asp:Label ID="Label_Pages" runat="server"></asp:Label><input type="button" class="page-split" />
                                    
                                    <asp:Button ID="Button_Pager_Next" runat="server" Text="" ToolTip="下一页" 
                                        CssClass="pageturn-next-b" onclick="Pager_Click" CommandName="+" />
                                    <asp:Button ID="Button_Pager_Last" runat="server" Text="" ToolTip="末页" 
                                        CssClass="pageturn-last-b" onclick="Pager_Click" CommandName="++" />
                                </td>
                                <td class="pagebar" align="right">
                                    <asp:Label ID="Label_Total" runat="server"></asp:Label>
                                </td>
                            </tr>
                       </table>

		            </td>
	            </tr>
            </table>
            

        </div>
    </div>
</form>
</body>
</html>
